﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddUser.aspx.cs" Inherits="Medianamik.UI.SecurityManagement.AddUser" 
MasterPageFile="../MasterPages/MedianamikModule.Master" %>

<asp:Content ID="ContextMenuContent" ContentPlaceHolderID="ContextMenu" runat="server">
    <asp:LinkButton ID="lnkSave" CssClass="Action BtSauvegarder" runat="server"><asp:Literal runat="server" Text="<%$ Resources: Medianamik_SecurityManagement,SaveUser %>"></asp:Literal> </asp:LinkButton>
    <a class="Action BtAnnuler" href="UserList.aspx" ><asp:Literal runat="server" Text="<%$Resources: Medianamik_Global, Cancel %>"></asp:Literal></a>
</asp:Content>

<asp:Content ID="CenterContent" ContentPlaceHolderID="CenterContent" runat="server">
    <asp:ValidationSummary ID="valSummary" EnableClientScript="false" runat="server" CssClass="ValidationSummary" />
	<h2><asp:Localize runat="server" Text="<%$ Resources: Medianamik_SecurityManagement, NewUserTitle %>"></asp:Localize></h2>
	<p><span class="ChampObligatoire">* </span><asp:Literal ID="Literal1" runat="server" Text="<%$ Resources: Medianamik_Global, RequiredField %>"></asp:Literal></p>

	<fieldset class="Colonne">
    	<div class="EditionControl">
    	    <asp:Label AssociatedControlID="txtUserName" runat="server" ><span class="ChampObligatoire">*</span><asp:Literal runat="server" Text="<%$ Resources: Medianamik_SecurityManagement, UserNameLabel %>"></asp:Literal></asp:Label>
    	    <asp:TextBox id="txtUserName" runat="server" CssClass="TxtBox"></asp:TextBox>
		    <asp:RequiredFieldValidator runat="server" Display="None" EnableClientScript="false" ControlToValidate="txtUserName" ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, ErrorEmptyUsername  %>"   ></asp:RequiredFieldValidator>
		    <asp:CustomValidator runat="server" Display="None" EnableClientScript="false"  ID="cvUsername" OnServerValidate="cvUsername_ServerValidate" ControlToValidate ="txtUserName" ErrorMessage = "<%$ Resources: Medianamik_SecurityManagement, UserAlreadyExistsError %>"></asp:CustomValidator>  
		</div>
		<div class="EditionControl">
		    <asp:Label runat="server" AssociatedControlID = "txtEmail"><span class="ChampObligatoire">*</span><asp:Literal runat="server" Text="<%$Resources: Medianamik_SecurityManagement, EmailLabel  %>"></asp:Literal></asp:Label>
		    <asp:TextBox runat="server" ID="txtEmail" CssClass="TxtBox"></asp:TextBox>
	        <asp:RequiredFieldValidator runat="server" Display = "None" EnableClientScript="false" ControlToValidate ="txtEmail" ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, ErrorEmptyEmailAddress %>"></asp:RequiredFieldValidator>
	        <asp:RegularExpressionValidator runat="server"  Display="None" EnableClientScript="false" ControlToValidate="txtEmail" ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, ErrorInvalidEmailAddress %>" ValidationExpression="^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$"></asp:RegularExpressionValidator>
	    </div>
        <div class="EditionControl">
            <asp:CheckBox runat="server" ID="chkAutoGeneratePwd" AutoPostBack="true" OnCheckedChanged ="chkAutoGeneratePwd_CheckedChanged" Text="<%$ Resources: Medianamik_SecurityManagement, AutoGeneratePasswordLabel %>" />
        </div>
        <asp:MultiView runat="server" ActiveViewIndex ="0" ID="mvPassword">
            <asp:View runat="server" ID="vwPassword">
               <div class="EditionControl">
                  <asp:Label runat="server" AssociatedControlID="txtPassword"><asp:Literal runat="server" Text="<%$Resources: Medianamik_SecurityManagement, PasswordLabel  %>"></asp:Literal></asp:Label>
                  <asp:TextBox id="txtPassword" runat="server" CssClass="TxtBox" TextMode="Password"></asp:TextBox>
                   <asp:RequiredFieldValidator runat="server" ID="rfvPassword"  EnableClientScript ="false" ControlToValidate="txtPassword" Display="None" ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, PasswordRequiredError %>" ></asp:RequiredFieldValidator>
		           <asp:CustomValidator ID="cvPasswordStrength" runat="server" EnableClientScript="false" ControlToValidate="txtPassword" ValidateEmptyText="true" Display="None" OnServerValidate="cvPasswordStrength_ServerValidate" ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, PasswordStrengthError %>" ></asp:CustomValidator>
               </div> 
		       <div class="EditionControl">
		            <asp:Label runat="server" AssociatedControlID= "txtConfirmPassword"><asp:Literal runat="server" Text="<%$Resources: Medianamik_SecurityManagement, PasswordConfirmationLabel  %>"></asp:Literal></asp:Label>
		            <asp:TextBox ID="txtConfirmPassword" runat="server" CssClass="TxtBox" TextMode="Password"></asp:TextBox>
		       </div>
		       <div class="EditionControl">
		            <strong><asp:Literal runat="server" Text="<%$ Resources: Medianamik_SecurityManagement, PasswordRulesLabel %>"></asp:Literal></strong>
		       </div>
		       <ul>
		        <li><asp:Literal runat="server" Text="<%$Resources: Medianamik_SecurityManagement, MinRequiredPasswordLength %>"></asp:Literal> <strong><%= Membership.MinRequiredPasswordLength  %></strong></li>
		        <li><asp:Literal ID="Literal3" runat="server" Text="<%$Resources: Medianamik_SecurityManagement, MinRequiredNonAlphanumericCharacters %>"></asp:Literal> <strong><%= Membership.MinRequiredNonAlphanumericCharacters  %></strong></li>
		       </ul>
		    
		       <asp:CustomValidator ID="cvPasswordCompare" runat="server" EnableClientScript="false" ControlToValidate="txtPassword" Display="none" ValidateEmptyText="true"
		         OnServerValidate="cvPasswordCompare_ServerValidate" ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, PasswordsDoNotMatchError %>" ></asp:CustomValidator>    
		    </asp:View>
		    <asp:View runat="server" ID="vwNoPassword">
		        <p><asp:Literal runat="server" Text="<%$ Resources: Medianamik_SecurityManagement, PasswordWillBeAutoGenerated %>"></asp:Literal></p>
		    </asp:View>
        </asp:MultiView>
		<div class="EditionControl">
		    <asp:CheckBox ID="chkEmail" runat="server" Text="<%$ Resources: Medianamik_SecurityManagement, SendConfirmationEmailQuestion %>" Checked="true" />
		</div>	
	</fieldset>
	<fieldset class="Colonne">
		<div class="EditionControl">
		    <asp:Label runat="server" AssociatedControlID ="txtCompleteName" ><span class="ChampObligatoire">*</span><asp:Literal runat="server" Text="<%$Resources: Medianamik_SecurityManagement, FullNameLabel %>"></asp:Literal></asp:Label>
		    <asp:TextBox ID="txtCompleteName" runat="server" CssClass="TxtBox"></asp:TextBox>
		    <asp:RequiredFieldValidator runat="server" Display ="none" EnableClientScript="false" ControlToValidate ="txtCompleteName" ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, ErrorEmptyFullName %>"></asp:RequiredFieldValidator>  
		</div>
		<div class="EditionControl">
		    <asp:Label runat="server" AssociatedControlID ="calExpirationDate" ><asp:Literal runat="server" Text="<%$Resources:Medianamik_SecurityManagement, UserExpirationDateLabel %>"></asp:Literal></asp:Label>
		    <telerik:RadDatePicker ID="calExpirationDate"  runat="server"  Skin="Medianamik" EnableEmbeddedSkins="false" ></telerik:RadDatePicker>
		</div>
		
		<div class="EditionControl">
		    <asp:Label runat="server" AssociatedControlID="ddlLanguage" ><span class="ChampObligatoire">*</span><asp:Literal runat="server" Text="<%$ Resources:Medianamik_SecurityManagement, UserCultureNameLabel %>"></asp:Literal></asp:Label>
		    <asp:DropDownList ID="ddlLanguage" runat="server" CssClass="SelectList" DataTextField="DisplayName" DataValueField="Name"  ></asp:DropDownList>
		</div>
		<div class="EditionControl">
		    <asp:CheckBox runat="server" ID="chkApproved" Checked="true" Text="<%$ Resources: Medianamik_SecurityManagement, User_IsApprovedChekbox %>" />
		</div>
		<div class="EditionControl">
		    <asp:Label runat="server" AssociatedControlID="cblGroups" ><span class="ChampObligatoire">*</span><asp:Literal runat="server" Text="<%$Resources: Medianamik_SecurityManagement, GroupsLabel  %>"></asp:Literal></asp:Label>
		    <med:GroupCheckBoxList id="cblGroups" runat="server" ></med:GroupCheckBoxList>
		</div>
	</fieldset>
	
	<div class="clear"></div>

</asp:Content>
